//
// NeL - bindings
// Copyright (C) 2010 Naush
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU Affero General Public License as
//published by the Free Software Foundation, either version 3 of the
//License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU Affero General Public License for more details.
//
//You should have received a copy of the GNU Affero General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

package org.ryzom.nel.misc;

public class CEventEmitterMulti extends IEventEmitter {
  private long swigCPtr;

  public CEventEmitterMulti(long cPtr, boolean cMemoryOwn) {
    super(nelmiscJNI.CEventEmitterMulti_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CEventEmitterMulti obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nelmiscJNI.delete_CEventEmitterMulti(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void addEmitter(IEventEmitter e, boolean mustDelete) {
    nelmiscJNI.CEventEmitterMulti_addEmitter(swigCPtr, this, IEventEmitter.getCPtr(e), e, mustDelete);
  }

  public void removeEmitter(IEventEmitter e) {
    nelmiscJNI.CEventEmitterMulti_removeEmitter(swigCPtr, this, IEventEmitter.getCPtr(e), e);
  }

  public boolean isEmitter(IEventEmitter e) {
    return nelmiscJNI.CEventEmitterMulti_isEmitter(swigCPtr, this, IEventEmitter.getCPtr(e), e);
  }

  public long getNumEmitters() {
    return nelmiscJNI.CEventEmitterMulti_getNumEmitters(swigCPtr, this);
  }

  public IEventEmitter getEmitter(long index) {
    long cPtr = nelmiscJNI.CEventEmitterMulti_getEmitter__SWIG_0(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IEventEmitter(cPtr, false);
  }

  public void submitEvents(CEventServer server, boolean allWindows) {
    nelmiscJNI.CEventEmitterMulti_submitEvents(swigCPtr, this, CEventServer.getCPtr(server), server, allWindows);
  }

  public void emulateMouseRawMode(boolean enable) {
    nelmiscJNI.CEventEmitterMulti_emulateMouseRawMode(swigCPtr, this, enable);
  }

  public boolean copyTextToClipboard(ucstring text) {
    return nelmiscJNI.CEventEmitterMulti_copyTextToClipboard(swigCPtr, this, ucstring.getCPtr(text), text);
  }

  public boolean pasteTextFromClipboard(ucstring text) {
    return nelmiscJNI.CEventEmitterMulti_pasteTextFromClipboard(swigCPtr, this, ucstring.getCPtr(text), text);
  }

  public CEventEmitterMulti() {
    this(nelmiscJNI.new_CEventEmitterMulti(), true);
  }

}
